Integrating Facebook iOS SDK with Your Application by 2013

Integrating Facebook iOS SDK with Your Application by 2013

Author:2013
Language: eng
Format: epub
Publisher: Packt Publishing


We need to customize the viewDidLoad method in order to build the UISearchBar on the friend picker view.

- (void)viewDidLoad { [super viewDidLoad]; [self addSearchBarToFriendPickerView]; }

The previous code shows the new viewDidLoad method with the new, not yet defined method addSearchBarToFriendPickerView. The new method initializes the searchBar, only if this one is set to nil. After the initialization is complete, the searchBar is added to the view container.

The following snippet shows the addSearchBarToFriendPickerView implementation.

- (void)addSearchBarToFriendPickerView { if (self.searchBar == nil) { CGFloat searchBarHeight = 44.0; self.searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width,searchBarHeight)]; self.searchBar.autoresizingMask =self.searchBar.autoresizingMask |UIViewAutoresizingFlexibleWidth; self.searchBar.delegate = self; self.searchBar.showsCancelButton = YES; // Adding the searchBar to the current view and resize thefriends' list table view [self.canvasView addSubview:self.searchBar]; CGRect newFrame = self.view.bounds; newFrame.size.height -= searchBarHeight; newFrame.origin.y = searchBarHeight; self.tableView.frame = newFrame; } }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.